function setShareConfig(Timelinetitle, Apptitle, desc, imgurl, Timelinelink, Applink, shareTimelineCb, shareAppMsgCb) {
    var Wx = function() {
        var config1 = {
            title: Apptitle,
            desc: desc,
            link: Applink,
            img_url: imgurl,
            "img_width": "120",
            "img_height": "120"
        };
        var config2 = {
            title: Timelinetitle,
            desc: desc,
            link: Timelinelink,
            img_url: imgurl,
            "img_width": "120",
            "img_height": "120"
        };
        var _bindWeixinShare = function() {
            WeixinJSBridge.on('menu:share:appmessage', function(argv) {
                WeixinJSBridge.invoke('sendAppMessage', config1, function(resp) {
                    _handleShareCall(resp.err_msg, "appmessage");
                    typeof shareAppMsgCb == 'function' && shareAppMsgCb();
                });
            });

            WeixinJSBridge.on('menu:share:timeline', function(argv) {
                WeixinJSBridge.invoke('shareTimeline', config2, function(resp) {
                    _handleShareCall(resp.err_msg, "timeline");
                    typeof shareTimelineCb == 'function' && shareTimelineCb();
                });
            });
        };
        var _handleShareCall = function(msg, operate) {
            var prefix = (operate == "timeline" ? "share_timeline" : "send_app_msg") + ":";
            if (msg == prefix + "confirm" || msg == prefix + "ok") {
                if (operate == "appmessage") {

                } else if (operate == "timeline") {

                }
            }
        };
        return {
            init: _bindWeixinShare
        }
    }();

    if (typeof window.WeixinJSBridge == "undefined") {
        document.addEventListener('WeixinJSBridgeReady', Wx.init, false);
    } else {
        Wx.init();
    }
};
if (typeof module == 'object') {
    module.exports = setShareConfig;
} else {
    window.setShareConfig = setShareConfig;
}